import * as THREE from 'three';
import Shelf from './shelf';

const shelf_list = [
    {StorageZoneId:'Z1',shelfId:'A1',shelfName:'货架A1',x:-200,y:0,z:-130},
    {StorageZoneId:'Z1',shelfId:'A2',shelfName:'货架A2',x:-100,y:0,z:-130},
    {StorageZoneId:'Z1',shelfId:'A3',shelfName:'货架A3',x:0,y:0,z:-130},
    {StorageZoneId:'Z1',shelfId:'A4',shelfName:'货架A4',x:100,y:0,z:-130},
    {StorageZoneId:'Z1',shelfId:'A5',shelfName:'货架A5',x:200,y:0,z:-130},
];

/**
 * 仓库类
 */
export default class Storage {
    constructor( option) {
        console.log('仓库类')

        this.parent =option._scene;
        this.shelfList = [];
        this.createStorage(option); // 生成仓库类
    }
    createStorage (option) {
        // 填充货架
        const shelfSize = shelf_list.length;
        for(let i = 0; i < shelfSize; i++){
            let shelf = shelf_list[i];
            this.shelfList.push(new Shelf({
                _scene:option._scene,
                _cargo:option._cargo,
                storage:this,
                ...shelf
            }));
        }
    };
  
 
}